import request from '@/utils/request'

export function getAppraises(data, offset, limit) {
  return request({
    url: '/appraise',
    method: 'get',
    params: {
      userId: data.userId,
      result: data.result,
      status: data.status,
      offset: offset,
      limit: limit
    }
  })
}

export function getMyAppraise() {
  return request({
    url: '/appraise/mine',
    method: 'get'
  })
}

export function getMemberAppraise() {
  return request({
    url: '/appraise/member',
    method: 'get'
  })
}

export function batchAddAppraise(data) {
  return request({
    url: '/appraise',
    method: 'post',
    data
  })
}

export function modifyAppraise(id, data) {
  return request({
    url: `/appraise/${id}`,
    method: 'put',
    data
  })
}

export function modifyAppraiseType(id, result) {
  return request({
    url: `/appraise/result/${id}?result=${result}`,
    method: 'put'
  })
}
